package com.utils.basehelper.string;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class date {
	public static void main(String[] args) {
		Date data = new Date();
		System.out.println(date.TimeStamp2Date("1555054023", "yyyy-MM-dd"));
	}
	
	public static String TimeStamp2Date(String timestampString, String formats) {
		Long timestamp = Long.parseLong(timestampString) * 1000;
		String date = new SimpleDateFormat(formats, Locale.CHINA).format(new Date(timestamp));
		return date;
	}
}
